package com.androidgame.framework.impl;

import android.media.SoundPool;
import com.androidgame.framework.Sound;

//Used to store a single sound
public class AndroidSound implements Sound 
{
	int soundId;
	SoundPool soundPool;
	
	
	public AndroidSound(SoundPool soundPool, int soundId) 
	{
		//store the SoundPool and the ID of the loaded sound effect
		this.soundId = soundId;
		this.soundPool = soundPool;
	}
	
	public void play(float volume) 
	{
		soundPool.play(soundId, volume, volume, 0, 0, 1);
	}
	
	public void dispose() 
	{
		soundPool.unload(soundId);
	}
}
